package com.cms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.List;


@Data
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="User对象", description="")
@ToString
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "头像地址")
    @TableField("avatar_url")
    private String avatarUrl;

    @ApiModelProperty(value = "账号")
    @TableField("user_number")
    private String no;

    @ApiModelProperty(value = "名字")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "密码")
    private String password;

    private Integer age;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "电话")
    @TableField("telephone")
    private String phone;

//    @ApiModelProperty(value = "角色 0管理员，1普通")
//    private Integer roleId;
    @ApiModelProperty(value = "角色 0管理员，1普通")
    private String roleId;//这里采用了额外添加代码的形式来校验roleid，所以类型换回String方便校验


    @ApiModelProperty(value = "是否禁用 Y启用 N禁用")
    @TableField("is_valid")
    private String isvalid;

    @TableField(exist = false)
    private List<Record> records;//建立用户和记录之间的关联关系

    //private String token;
    //用了userDTO这里的token就要注释掉，不然会报错
}
